#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QNetworkReply>
#include <QNetworkAccessManager>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void enterEvent(QEvent *e);  //--鼠标进入事件
    void leaveEvent(QEvent *e);  //--鼠标离开事件
    void mousePressEvent(QMouseEvent *e);       //--鼠标按下事件
    void mouseMoveEvent(QMouseEvent *e);       //--鼠标移动事件
    void mouseReleaseEvent(QMouseEvent *e);   //--鼠标释放（松开）事件
    void setMainTextEdit(QString hex);
    void getAccessToken();
    void getTextByApi();
    void recognition();

private slots:
    void on_action_2_triggered();
    void getNewStr(QString);
    void getAccessTokenRequestFinished(QNetworkReply* reply);
    void recognitionRequestFinished(QNetworkReply* reply);
    void on_action_triggered();

    void on_action_3_triggered();

    void on_action_4_triggered();

private:
    Ui::MainWindow *ui;
    bool leftPress;
    QPoint beginPos;
    QString accessToken;
    QNetworkAccessManager *nam;
};

#endif // MAINWINDOW_H
